package com.dony.web.controller.statistic;

import com.dony.common.core.controller.BaseController;
import com.dony.common.core.domain.AjaxResult;
import com.dony.statistic.service.IStatisticService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author sundw
 * @version 1.0.0
 * @description IndexController
 * @since 2023/10/22 1:12
 */
@Slf4j
@RestController
@RequestMapping("/statistic/index")
public class IndexController extends BaseController {

    @Resource
    IStatisticService statisticService;

    /**
     * 获取顶部的面板数据
     */
    @GetMapping("/panel")
    public AjaxResult getPanelData() {
        return AjaxResult.success(statisticService.getIndexPanelGroupData());
    }

    /**
     * 获取顶部的面板数据
     */
    @GetMapping("/daily")
    public AjaxResult getDailySaleData() {
        return AjaxResult.success(statisticService.getDailySaleData());
    }

    /**
     * 获取顶部的面板数据
     */
    @GetMapping("/month")
    public AjaxResult getMonthSaleData() {
        return AjaxResult.success(statisticService.getMonthSaleData());
    }


    /**
     * 获取顶部的面板数据
     */
    @GetMapping("/pie")
    public AjaxResult getMerchantSaleData() {
        return AjaxResult.success(statisticService.getMerchantSaleData());
    }


}
